package com.zhonghui.common.eshopEnum;

import java.util.stream.Stream;

public enum  BillInfoEnum {
    DEAFUL_ALL(0, "所有"),
    PAY_PRODUCT(1, "消费"),
    RECHAREGE(2, "充值"),
    BROKERAGE(3, "返佣"),
    EXTRACT(4, "提现"),
    SIGN_INTEGRAL(5, "签到积分"),
    PAY_PRODUCT_REFUND(6, "退款"),
    SYSTEM_ADD(7, "系统添加"),
    SYSTEM_SUB(8, "系统减少");

    private Integer value;
    private String desc;

    public static BillInfoEnum toType(int value) {
        return (BillInfoEnum) Stream.of(values()).filter((p) -> {
            return p.value == value;
        }).findAny().orElse( (BillInfoEnum) null );
    }

    public Integer getValue() {
        return this.value;
    }

    public String getDesc() {
        return this.desc;
    }

    private BillInfoEnum(final Integer value, final String desc) {
        this.value = value;
        this.desc = desc;
    }
}

